package com.czl.dxpro.dx_09_taskNine;

import java.io.IOException;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.io.NullWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Job;
import org.apache.hadoop.mapreduce.lib.input.FileInputFormat;
import org.apache.hadoop.mapreduce.lib.output.FileOutputFormat;

public class DxNineMain {

	public static void main(String[] args) throws IllegalArgumentException, IOException, ClassNotFoundException, IllegalStateException, InterruptedException {
		// TODO Auto-generated method stub
		Job job1 = Job.getInstance();
		job1.setJarByClass(DxNineMain.class);
		job1.setMapperClass(NineMapper.class);
		job1.setMapOutputKeyClass(Text.class);
		job1.setMapOutputValueClass(Text.class);
		
		job1.setReducerClass(NineRudece.class);
		job1.setOutputKeyClass(NullWritable.class);
		job1.setOutputValueClass(Text.class);	
		
		job1.addCacheFile(new Path("d://data/dx/configData/t_dx_basic_classify_link.txt").toUri());
		FileInputFormat.addInputPath(job1,new Path("d://data/dx/DxStaOne"));
		FileOutputFormat.setOutputPath(job1,new Path("d://data/dx/DxDxNine"));
		System.exit(job1.waitForCompletion(true)?0:1);
		}
}




